home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / BaseExemplar.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  2.5 KB  |  65 lines

  1. package com.extensibility.xml;
  2.  
  3. import java.io.StringWriter;
  4. import java.io.Writer;
  5. import java.util.Hashtable;
  6. import java.util.ResourceBundle;
  7. import java.util.Vector;
  8.  
  9. public class BaseExemplar implements ExportInterface {
  10.    SchemaIntf schema;
  11.    static ResourceBundle res;
  12.    Vector declsToFill;
  13.    Hashtable declsFound;
  14.  
  15.    public BaseExemplar(SchemaIntf var1) {
  16.       this.setSchema(var1);
  17.    }
  18.  
  19.    public static void setResources(ResourceBundle var0) {
  20.       res = var0;
  21.    }
  22.  
  23.    public void setSchema(SchemaIntf var1) {
  24.       this.schema = var1;
  25.    }
  26.  
  27.    public Vector getDataDecls(ElementDeclaration var1) {
  28.       this.declsToFill = new Vector();
  29.       this.declsFound = new Hashtable();
  30.       (new ElemProxy(this, var1)).getDataDecls();
  31.       return this.declsToFill;
  32.    }
  33.  
  34.    public String getSourcePreview(BaseDeclaration var1) {
  35.       StringWriter var2 = new StringWriter();
  36.       SXE var3 = new SXE(var2);
  37.       if (var1 instanceof ElementDeclaration) {
  38.          (new ElemProxy(this, (ElementDeclaration)var1)).write(var3, false);
  39.       } else if (var1 instanceof AttributeDeclaration) {
  40.          (new AttrProxy(this, (AttributeDeclaration)var1)).write(var3);
  41.       }
  42.  
  43.       var3.flush();
  44.       return var2.toString();
  45.    }
  46.  
  47.    public void writeDocument(Writer var1, ElementDeclaration var2) {
  48.       SXE var3 = new SXE(var1);
  49.       var3.writeHeader("1.0");
  50.       this.writeDocType(var3, var2);
  51.       var3.writeComment("Generated by XML Authority.");
  52.       (new ElemProxy(this, var2)).write(var3, true);
  53.       var3.flush();
  54.    }
  55.  
  56.    public void writeDocument(Writer var1) {
  57.    }
  58.  
  59.    protected void writeDocType(SXE var1, ElementDeclaration var2) {
  60.    }
  61.  
  62.    protected void writeDeclNameSpace(SXE var1, BaseDeclaration var2) {
  63.    }
  64. }
  65.